// 做301跳转头部等设置
export const asset = app => {
  app.use(async(ctx, next) => {
    if (/^([^\.\#\?]*[^\/])$/.test(ctx.request.url)) {
      ctx.status = 301;
      ctx.redirect(ctx.request.url + '/');
    }
    await next();
  })
}